package cn.fzkj.springcloud.config;

import cn.fzkj.springcloud.service.HystrixService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 第一种方式
 */
@Component
public class FallBackFactory implements FallbackFactory<HystrixService> {
    @Override
    public HystrixService create(Throwable throwable) {
        return new HystrixService() {
            @Override
            public String get(Long id) {
                return "FallBackFactory -- feign 远程调用异常 😭";
            }
        };
    }
}
